package util

const (
	SUCCESS = 200
	ADD_SUSSESS = 2001
	DELETE_SUSSESS = 2007
	UPDATE_SUSSESS = 2200
	//价格
	SUB_SUSSESS_PRICE = 2002
	DELETE_SUSSESS_PRICE = 2003
	//账号
	DELETE_SUSSESS_ACCOUNT = 2004
	//策略
	STOP_SUSSESS_STRATEGY = 2005
	START_SUSSESS_STRATEGY = 2006
	CREATE_STRATEGY_SUSSESS = 2013
	DEL_SUSSESS_STRATEGY = 2014
	//订单
	CLOSE_ORDER_SUSSESS = 2008
	CANCEL_ORDER_SUSSESS = 2009
	USE_ORDER_SUSSESS  = 2010
	LIMIT_CLOSE_ALL_ORDER_SUSSESS = 2011
	MARKET_CLOSE_ALL_ORDER_SUSSESS = 2012



	ERROR = 500
	ADD_ERROR = 5001
	ADD_HAVE_DATA = 5002
	FUND_ERROR = 5013
	UPDATE_ERROR =5200
	//价格
	SUB_HAVE_PRICE = 5003
	SUB_ERROR_PRICE = 5004
	UNSUB_ERROR_PRICE = 5005
	NOT_SUB_PRICE = 5010
	//账号
	ADD_HAVE_ACCOUNT = 5006
	ADD_ERROR_ACCOUNT = 5007
	DEL_ERROR_ACCOUNT = 5008
	NOT_USER_ERROR = 5014
	//策略
	STOP_ERROR_STRATEGY = 5009
	START_ERROR_STRATEGY = 5011
	EIST_START_STRATEGY_ERROR = 5012
	STOP_STRATEGY_ERROR_NOT_KEY =  5018
	CREATE_STRATEGY_ERROR = 5019
	DEL_ERROR_STRATEGY = 5020
	START_STRATEGY_USE_ERROR = 5021
	NOT_STRATEGY_ERROR = 5100
	STOP_STRATEGY_ERROR_NOT_START = 5101
	START_STRATEGY_ERROR_NOT_KEY = 5102
	CREATE_STRATEGY_ERROR_NOT_ORDERSUB = 5103
	//订单
	USE_ORDER_ERROR = 5015
	LIMIT_CLOSE_ALL_ORDER_ERROR =5016
	MARKET_CLOSE_ALL_ORDER_ERROR =5017





	CONN_DATABASE_ERROR = "连接数据库失败"
)


var codeMsg =map[int] string{
	SUCCESS : "OK",
	ADD_ERROR:"添加失败",
	ERROR : "FAIL",
	ADD_SUSSESS : "添加成功",
	ADD_HAVE_DATA :"不能重复添加",
	DELETE_SUSSESS:"删除成功",
	FUND_ERROR:"查询失败",
	UPDATE_SUSSESS:"更新成功",
	UPDATE_ERROR:"更新失败",

	//价格
	SUB_SUSSESS_PRICE:"订阅价格成功",
	SUB_HAVE_PRICE:"已经存在订阅价格",
	SUB_ERROR_PRICE:"订阅价格失败",
	UNSUB_ERROR_PRICE:"没有订阅价格信息，取消失败",
	DELETE_SUSSESS_PRICE:"删除价格成功",
	DELETE_SUSSESS_ACCOUNT:"删除账号成功",
	NOT_SUB_PRICE:"没有订阅该价格",

	//账号
	ADD_HAVE_ACCOUNT:"已经存在用户",
	ADD_ERROR_ACCOUNT:"添加账号失败",
	DEL_ERROR_ACCOUNT:"删除账号失败",
	NOT_USER_ERROR:"没有该用户",

	//策略
	STOP_SUSSESS_STRATEGY:"停止策略成功",
	START_SUSSESS_STRATEGY:"启动策略成功",
	CREATE_STRATEGY_SUSSESS:"创建策略成功",
	DEL_SUSSESS_STRATEGY:"删除策略成功",

	STOP_ERROR_STRATEGY:"停止策略失败",
	START_ERROR_STRATEGY:"启动策略失败",
	START_STRATEGY_ERROR_NOT_KEY:"停止策略失败，没有找到对应到策略key",
	EIST_START_STRATEGY_ERROR:"当前策略已启动，不需要重新启动",
	STOP_STRATEGY_ERROR_NOT_KEY:"停止策略失败，没有找到对应到策略key",
	STOP_STRATEGY_ERROR_NOT_START:"停止策略失败，没启动该策略",
	CREATE_STRATEGY_ERROR:"创建策略失败,暂时没有该策略",
	CREATE_STRATEGY_ERROR_NOT_ORDERSUB:"创建策略失败,没有订阅订单",
	DEL_ERROR_STRATEGY:"删除策略失败",
	START_STRATEGY_USE_ERROR:"策略已经启动",
	NOT_STRATEGY_ERROR:"没有该策略",

	//订单
	CLOSE_ORDER_SUSSESS:"平仓成功",
	CANCEL_ORDER_SUSSESS:"撤单成功",
	USE_ORDER_SUSSESS:"下单成功",
	USE_ORDER_ERROR:"下单失败",
	LIMIT_CLOSE_ALL_ORDER_ERROR:"限价平所有仓位失败",
	LIMIT_CLOSE_ALL_ORDER_SUSSESS:"限价平所有仓位成功",
	MARKET_CLOSE_ALL_ORDER_ERROR:"市价平所有仓位失败",
	MARKET_CLOSE_ALL_ORDER_SUSSESS:"市价平所有仓位成功",


}

func GetErrMsg(code int)string  {
	return codeMsg[code]
}